const goodsModel = require("../models/Ridgepole_model");



function getrp(goods, onRetGot, onErrGot) {
    goodsModel.select(goods, (ret) => onRetGot({ret,code:200,total:""}), (err) => onErrGot({ err ,code:400}));
    
}




function addrp(goods, onRetGot, onErrGot) {
    console.log("goods2",goods);
    goodsModel.add(goods,(ret)=>onRetGot({ret,code:200}),(err)=>onErrGot({err,code:400}))
}

function deleterp(goods, onRetGot, onErrGot) {
    goodsModel.re (goods, (ret) => onRetGot({ret,code:200}), (err) => onErrGot({ err ,code:400}));
    
}

function updaterp(goods, onRetGot, onErrGot) {
    console.log(goods);
    goodsModel.update(goods, (ret) => onRetGot({ret,code:200}), (err) => onErrGot({ err ,code:400}));
    
}


const userController = {
    getrp,
    deleterp,
    addrp,
    updaterp,
};
module.exports = userController;